﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace LP
{
    /// <summary>
    /// Interaction logic for GraphsHelp.xaml
    /// </summary>
    public partial class GraphsHelp : Window
    {
        /// <summary>
        /// Constructor of GraphsHelp class
        /// </summary>
        public GraphsHelp()
        {
            InitializeComponent();
            List<Item> items = new List<Item>();
            items.Add(new Item() { Action = "Mover", Shorcut = "Botão direito do rato" });
            items.Add(new Item() { Action = "Zoom", Shorcut = "Roda do rato" });
            items.Add(new Item() { Action = "Zoom por rectangulo", Shorcut = "Ctrl + Botão direito do rato" });
            items.Add(new Item() { Action = "Mostrar informação", Shorcut = "Botão esquerdo do rato" });
            items.Add(new Item() { Action = "Restaurar eixos", Shorcut = "Tecla 'A'" });
            items.Add(new Item() { Action = "Copiar bitmap", Shorcut = "Ctrl + C" });
            items.Add(new Item() { Action = "Copiar código", Shorcut = "Ctrl + Alt + C" });
            items.Add(new Item() { Action = "Copiar propriedades", Shorcut = "Ctrl + Alt + R" });
            listShorcuts.ItemsSource = items;
            this.CenterWindowOnScreen();
        }

        // Centrar a janela ao meio
        /// <summary>
        /// Center MainWindow on screen
        /// </summary>
        private void CenterWindowOnScreen()
        {
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            double windowWidth = this.Width;
            double windowHeight = this.Height;
            this.Left = (screenWidth / 2) - (windowWidth / 2);
            this.Top = (screenHeight / 2) - (windowHeight / 2);
        }



        public class Item
        {
            public string Action { get; set; }

            public string Shorcut { get; set; }
        }



    }
}
